﻿@model Model.EntrustManage.E_tb_EntrustTesting
@{
    ViewBag.Title = "EntrustTestingEdit";
}
<!DOCTYPE html>

<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
</head>
<body>
        @using (Ajax.BeginForm("Save", "EntrustTesting", new AjaxOptions { HttpMethod = "Post", OnSuccess = "handle", OnFailure = "failed" }, new { @id = "frmUpdate" }))
        {
            @Html.HiddenFor(m => m.EntrustID, new { @id = "HidEntrustID" })
            @Html.HiddenFor(m => m.EditType, new { @id = "HidEditType" })
            @Html.HiddenFor(m => m.TaskNo, new { @id = "HidTaskNo" })
            @Html.HiddenFor(m => m.ReportID, new { @id = "HidReportID" })
            @Html.HiddenFor(m => m.IsComplete, new { @id = "HidIsComplete" })
            <table border="0" cellpadding="0" cellspacing="0" width="98%" class="DialogTable">
                <tr>
                    <td width="70px" align="right">样品名称：</td>
                    <td align="left" colspan="3">@Html.DropDownListFor(m => m.SampleID, ViewData["SampleList"] as SelectList, new { @id = "Drop_SampleID", @style = "width:99%;" })</td>
                </tr>
                <tr>
                    <td width="90px" align="right">检验项目：</td>
                    <td align="left" colspan="3">@Html.DropDownListFor(m => m.ProjectID, ViewData["ProjectList"] as SelectList, new { @style = "width:99%;" })</td>
                </tr>
                 <tr>
                    <td width="70px" align="right">委托单位：</td>
                    <td align="left" >@Html.TextBoxFor(m => m.EntrustCompany, new { @style = "width:99%;", @id = "txt_EntrustCompany", @disabled = "disabled" })</td>
                    <td width="90px" align="right">送/抽检日期：</td>
                    <td align="left">@Html.TextBoxFor(m => m.SubmissionTime, new { @style = "width:99%;", @onclick = "WdatePicker()", @id = "txt_SubmissionTime", @disabled = "disabled" })</td>
                </tr>
                <tr>
                    <td align="right">检验人：</td>
                    <td align="left" >@Html.DropDownListFor(m => m.TestPersonnelID, ViewData["PersonnelList"] as SelectList)</td>
                    <td width="90px" align="right">任务单号：</td>
                    <td align="left" style="width:160px;">@Html.TextBoxFor(m => m.TaskNo, new { @style = "width:99%;", @id = "txt_TaskNo", @disabled = "disabled" })</td>
                </tr>
                <tr>
                    <td colspan="4" align="center">
                        <a href="javascript:void(0)" onclick="$('#frmUpdate').submit()"><img src="~/Content/Images/baocun.png" height="20px" /></a>
                        <a href="javascript:void(0)" onclick="Close()"><img src="~/Content/Images/quxiao.png" height="20px" /></a>
                    </td>
                </tr>
            </table>
        }


        <script type="text/javascript">
            $(document).ready(function () {
                //加载样品列表
                function LoadBaseData() {
                    var SampleID = $("#Drop_SampleID").val();
                    $.ajax({
                        async: false,
                        type: "get",
                        url: "/EntrustTesting/GetBaseData?SampleID=" + SampleID,
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            var optionlist = eval(data);
                            $("#txt_SubmissionTime").val(optionlist[0]);
                            $("#txt_EntrustCompany").val(optionlist[1]);
                        }
                    });
                }

                //绑定项目选择事件
                $("#Drop_SampleID").change(function () {
                    LoadBaseData(); //动态设置单位、日期、单号
                });

                LoadBaseData(); //动态设置单位、日期、单号
            });
        </script>
</body>